package com.licheng.controller;

import com.licheng.pojo.*;
import com.licheng.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController

public class ReportController {

    @Autowired
    private ReportService reportService;

    /**
     * 统计职位人数
     * @return
     */
    @GetMapping("/report/empJobData")
    public Result empJobData() {
        JobOption jobOption = reportService.empJobData();
        return Result.success(jobOption);
    }

    /**
     * 统计员工性别
     * @return
     */
    @GetMapping("/report/empGenderData")
    public Result empGender(){
        List<Map> genderOption = reportService.empGender();
        return Result.success(genderOption);
    }

    /**
     * 统计学员学历人数
     * @return
     */
    @GetMapping("/report/studentDegreeData")
    public Result studentDegreeData() {
        List<Map> degreeList = reportService.studentDegreeData();
        return Result.success(degreeList);
    }

    /**
     * 统计班级人数
     * @return
     */
    @GetMapping("/report/studentCountData")
    public Result studentCountData() {
        ClazzCountOption clazzCountOptionList = reportService.studentCountData();
        return Result.success(clazzCountOptionList);
    }

    /**
     * 日志列表查询
     * @param logPageQuery
     * @return
     */
    @GetMapping("/log/page")
    public Result log(LogPageQuery logPageQuery) {
        LogPageResult log = reportService.logPageSelect(logPageQuery);

        return Result.success(log);
    }
}
